/*
 * This file is part of aKoustiK.

 * aKoustiK is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * aKoustiK is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with aKoustiK.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef ITEM_H
#define ITEM_H

#include <QtCore/QString>
#include <KUrl>

/**
  Class that represents single item in playlist.
  It should not contain any logic, only handling of
  self and internal fields.
  */
class Item {

private:

    // fields:
    QString mTitle;
    QString mArtist;
    QString mAlbum;
    QString mYear;
    QString mDuration;
    KUrl mUrl;
    int mDurationSeconds;

public:

    // constructors/destructors:
    Item();
    Item(const KUrl& url);
    Item(const Item& item);
    ~Item();

    // overrides:
    bool operator ==(const Item& other) const;
    bool operator ==(const KUrl& url) const;
    bool operator !=(const Item& other) const;
    bool operator !=(const KUrl& url) const;
    Item& operator=(const Item& other);

    // validation:
    /** Check if current item is valid. Item is valid if it's url is valid. */
    bool isValid() const;

    // getters:
    const QString& title() const;
    const QString& artist() const;
    const QString& album() const;
    const QString& year() const;
    const QString& duration() const;
    const KUrl& url() const;
    int durationSeconds() const;

    // setters:
    void setTitle(const QString& value);
    void setArtist(const QString& value);
    void setAlbum(const QString& value);
    void setYear(const QString& value);
    void setDuration(const QString& value);
    void setUrl(const KUrl& value);
    void setDurationSeconds(const int value);

};

#endif
